import os

CONFIG_FILE_PATH = f"file{os.sep}config.ini"

JAVA_HOME = "JAVA_HOME"

MAVEN = "maven"

GIT = "git"

JDK = "jdk"

SSL = "ssl"

SKIP_TESTS = "skip-tests"

OFFLINE = "offline"

MULTITHREAD = "multithread"

CMD = "cmd"

FLATTEN_CLEAN = "flatten-clean"

# ---------------------------------------------------------------- windows 命令行

WIN_SET_ENVIRONMENT_VARIABLE = "setx {} \"{}\""

WIN_SET_ENVIRONMENT_VARIABLE_M = "setx {} \"{}\" /m"

WIN_PATH_ENVIRONMENT_VARIABLE = "Path"

WIN_ECHO_ENVIRONMENT_VARIABLE = "echo %{}%"

WIN_GET_ENVIRONMENT_VARIABLE = """
$var = $env:{}
Write-Output $var
"""

WIN_MODIFY_ENVIRONMENT_VARIABLE = """
$env:{var_key} = '{value}'

[System.Environment]::SetEnvironmentVariable('{var_key}', '{value}', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('{var_key}', '{value}', [System.EnvironmentVariableTarget]::User)
"""

WIN_GET_EXECUTIONPOLICY = "Get-ExecutionPolicy"

WIN_SET_EXECUTIONPOLICY = "Set-ExecutionPolicy RemoteSigned"

WIN_IMPORT_MODULE = f"Import-Module $env:ChocolateyInstall{os.sep}helpers{os.sep}chocolateyProfile.psm1"

WIN_REFRESHENV = "refreshenv"

# ---------------------------------------------------------------- maven 命令行

MAVEN_FLATTEN_CLEAN = "{} flatten:clean"

MAVEN_CLEAN = "{} clean"

MAVEN_CLEAN_COMPILE = "{} clean compile"

MAVEN_CLEAN_INSTALL = "{} clean install"

MAVEN_CLEAN_DEPLOY = "{} clean source:jar deploy"

MAVEN_CLEAN_PACKAGE = "{} clean package"

MAVEN_SPRING_BOOT_RUN = "{} clean spring-boot:run"

MAVEN_TREE = "{} dependency:tree -Dincludes=:{}"

MAVEN_PULL_REMOTE = "{} dependency:get -DremoteRepositories={}  -DgroupId={} -DartifactId={} -Dversion={}"

MAVEN_REFRESH_JDK_AND_EXC = """
$env:{var_key} = '{value}'
{command_line}
"""
